<include file="../top" />
<script type='text/javascript'>
  function insert_check(){
    if(cate_insert.cate_name.value==''){
     alert('按要求填写！');
     return false;
    }
    return true;
  }
  function upd_check(){
    if(cate_upd.cate_name.value==''){
     alert('按要求填写！');
     return false;
    }
    return true;
  }

</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />

        <div id="right">
        <div style='width:900px;height:5px;background-color:#a1d2ff;margin-top:8px;'></div>
        <div style='width:400px;height:200px;margin-top:20px;margin-right:auto;margin-left:auto;'>

        	 <form name='cate_insert' action="insert_cate" method='post'>
        	<table>
        		<tr style='height:40px;'>
        			<td>添加分类名:</td>
        			<td><input name='cate_name'></td><td style='color:red'>&nbsp;*</td>
        		</tr>
        		<tr>
	        			<td>添加到该分类下:</td>
	        			<td>
	        			<select name='cate_sel'>
	        			<option value='0' selected>最顶级别</option>
	                         <volist name='list_cate' id ='list'>
		                        <option value='{$list.cate_id}|{$list.bpath}'>
		                             <php>
								              $spa ='';
								           for($i=0;$i<$list['count'];$i++){
							                  echo $spa.='&nbsp;';
								           };
								           echo $spa;
								    </php>{$list.cate_name}
		                        </option>
	                         </volist>
	                   </select>
	                   </td>
        		</tr>
        	      <tr style='margin-top:10px;height:50px;''>
	        	    <td >加个备注：</td>
	        	    <td ><textarea name='remark'></textarea> </td>
        	    </tr>
        		<tr>
        			<td></td>
        			<td style='float:right;margin-top:12px;'><input type='submit' name='sub' value='submit' onclick='return insert_check()'></td>
        		</tr>


        	</table>
        	</form>
        </div>
        <div style='width:900px;height:5px;background-color:#a1d2ff;margin-top:8px;'></div>
        <div style='width:400px;height:200px;margin-top:20px;margin-right:auto;margin-left:auto;'>

        	 <form name='cate_del' action="del_cate" method='post'>
        	<table>
        		<tr>
	        			<td>删除该分类以及子分类:</td>
	        			<td></td>
        		</tr>

        		<tr>
        			<td><select name='cate_sel'>
	                         <volist name='list_cate' id ='list'>
		                        <option value='{$list.cate_id}|{$list.bpath}'>
		                             <php>
								              $spa ='';
								           for($i=0;$i<$list['count'];$i++){
							                  echo $spa.='&nbsp;';
								           };
								           echo $spa;
								    </php>{$list.cate_name}
		                        </option>
	                         </volist>
	                   </select></td>
        			<td style='float:right;margin-top:12px;'><input type='submit' name='sub' value='delete'></td>
        		</tr>


        	</table>
        	</form>
        </div>
        <div style='width:900px;height:5px;background-color:#a1d2ff;margin-top:8px;'></div>
        <div style='width:400px;height:200px;margin-top:20px;margin-right:auto;margin-left:auto;'>

        	 <form name='cate_upd' action="upd_cate" method='post'>
        	<table>

        		<tr>
	        			<td>把该分类名称:</td>
	        			<td>
	        			<select name='cate_sel'>
	                         <volist name='list_cate' id ='list'>
		                        <option value='{$list.cate_id}|{$list.bpath}'>
		                             <php>
								              $spa ='';
								           for($i=0;$i<$list['count'];$i++){
							                  echo $spa.='&nbsp;';
								           };
								           echo $spa;
								    </php>{$list.cate_name}
		                        </option>
	                         </volist>
	                   </select>
	                   </td>
        		</tr>
        		<tr style='height:40px;'>
        			<td>修改为:</td>
        			<td><input name='cate_name'></td><td style='color:red'>&nbsp;*</td>
        		</tr>
        		<tr style='margin-top:10px;height:50px;''>
	        	    <td >写个备注：</td>
	        	    <td ><textarea name='remark'></textarea> </td>
        	    </tr>
        		<tr>
        			<td></td>
        			<td style='float:right;margin-top:12px;'><input type='submit' name='sub' value='update' onclick='return upd_check();'></td>
        		</tr>

        	</table>
        	</form>
        </div>
    </div>
</div>

</body>
</html>